package com.lagou.rpc.consumer.config;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.proxy.RpcClientProxy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author rephilo
 */
@Configuration
public class InitConfiguration {

    @Autowired
    private RpcClientProxy rpcClientProxy;

    @Bean
    public IUserService userService(){
        return (IUserService) rpcClientProxy.createProxy(IUserService.class);
    }
}
